library(ggplot2)
library(dplyr)##
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
##
## filter, lag
## The following objects are masked from 'package:base':
##
## intersect, setdiff, setequal, union
library(tidyverse)## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.0 ──
## ✓ tibble 3.1.0 ✓ purrr 0.3.4
## ✓ tidyr 1.1.3 ✓ stringr 1.4.0
## ✓ readr 1.4.0 ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(arsenal)
library(data.table)##
## Attaching package: 'data.table'
## The following object is masked from 'package:purrr':
##
## transpose
## The following objects are masked from 'package:dplyr':
##
## between, first, last
library(expss)##
## Attaching package: 'expss'
## The following objects are masked from 'package:data.table':
##
## copy, like
## The following objects are masked from 'package:stringr':
##
## fixed, regex
## The following objects are masked from 'package:purrr':
##
## keep, modify, modify_if, transpose, when
## The following objects are masked from 'package:tidyr':
##
## contains, nest
## The following objects are masked from 'package:dplyr':
##
## between, compute, contains, first, last, na_if, recode, vars
## The following object is masked from 'package:ggplot2':
##
## vars
sleephygiene <- read_csv("/Users/Ivanics/Desktop/SPH/4th term/HealthComm/Qualtrics post/Sleep Hygiene Post-Survey_May 9, 2021_19.51.csv")##
## ── Column specification ────────────────────────────────────────────────────────
## cols(
## .default = col_character()
## )
## ℹ Use `spec()` for the full column specifications.
sleephygiene$StartDate <- lubridate::ymd_hms(sleephygiene$StartDate)## Warning: 2 failed to parse.
#Filter to include only responses beyond this time
sleephygiene <- sleephygiene %>% filter(StartDate >= "2021-04-29 00:00:00")
#Select out the variables we need
sleephygiene <- sleephygiene %>% select(Progress, `Duration (in seconds)`, Finished, LocationLatitude, LocationLongitude, DistributionChannel, UserLanguage, Q1, Q2, Q3, Q2_5_TEXT, Q4, Q5, Q6, Q37, Q92, Q93, Q94, Q38, Q39, Q10_2, Q10_3, Q9, Q61, Q84, Q85, Q81, Q63, Q96_1, Q96_2, Q96_3, Q96_4, Q96_5, Q96_6, Q96_7, Q96_8, Q95, Q83, Q82, Q69, Q62, Q64, Q90, Q91, Q89_1, Q67_1, Q67_2, Q67_3, Q75_1, Q75_2, Q75_3, Q68, Q70, Q70_18_TEXT, Q87, Q71, Q72, Q79, Q79_5_TEXT, Q74, Q73, Q73_5_TEXT, Q59_1, Q59_2, Q59_3, Q59_4, Q44_1, Q44_2, Q44_3, Q44_4, Q44_5, Q44_6, Q44_7, Q44_8, Q44_9, Q52)
sleephygiene <- rowid_to_column(sleephygiene, "ID")#General factor recoding
sleephygiene <- sleephygiene %>% mutate(
Q1_consent = factor(Q1)) %>%
mutate(Q2_program = factor(Q2)) %>%
mutate(Q3_role = factor(Q3)) %>%
mutate(Q4_gender = factor(Q4)) %>%
mutate(Q5_age = factor(Q5)) %>%
mutate(Q6_numberinhousehold = as.numeric(Q6)) %>%
mutate(Q37_employed = factor(Q37)) %>%
mutate(Q92_notSPHemployed = factor(Q92)) %>%
mutate(Q93_worksetting = factor(Q93)) %>%
mutate(Q94_dayornight = factor(Q94)) %>%
mutate(Q38_worksetting = factor(Q38)) %>%
mutate(Q39_dayornight = factor(Q39)) %>%
mutate(Q10_hoursofsleeplast5workdays = as.numeric(Q10_2)) %>%
mutate(Q10_hoursofsleeppastweekend = as.numeric(Q10_3)) %>%
mutate(Q9_howoftensleepypastmonth = factor(Q9)) %>%
mutate(Q61_howoftensleepypasttwoweeks = factor(Q61)) %>%
mutate(Q84_awareofhowtoimprovesleepquality = factor(Q84)) %>%
mutate(Q81_seenorheardfromGNbloombergcampaign = factor(Q81)) %>%
mutate(Q63_recalltoolsfreetect = factor(Q63)) %>%
mutate(Q96_picture1 = factor(Q96_1)) %>%
mutate(Q96_picture2 = factor(Q96_2)) %>%
mutate(Q96_picture3 = factor(Q96_3)) %>%
mutate(Q96_picture4 = factor(Q96_4)) %>%
mutate(Q96_picture5 = factor(Q96_5)) %>%
mutate(Q96_picture6 = factor(Q96_6)) %>%
mutate(Q96_picture7 = factor(Q96_7)) %>%
mutate(Q96_picture8 = factor(Q96_8)) %>%
mutate(Q95_talkedtoanyone = factor(Q95)) %>%
mutate(Q82_knowanyonewhoengaged = factor(Q82)) %>%
mutate(Q69_didyouengagewiththecampaign = factor(Q69)) %>%
mutate(Q90_areyouhappywithyoursleepquality_awareofcampaign = factor(Q90)) %>%
mutate(Q91_areyouhappywithyoursleepquality_notawareofcampaign = factor(Q91)) %>%
mutate(Q89_ratesleepquality_notawareofcampaign = factor(Q89_1)) %>%
mutate(Q67_move30minutes = as.numeric(Q67_1)) %>%
mutate(Q67_breathing = as.numeric(Q67_2)) %>%
mutate(Q67_powerdown = as.numeric(Q67_2)) %>%
mutate(Q75_moving = factor(Q75_1)) %>%
mutate(Q75_breathing = factor(Q75_2)) %>%
mutate(Q75_powerdown = factor(Q75_3)) %>%
mutate(Q68_timing = factor(Q68)) %>%
mutate(Q87_idealtime = factor(Q87)) %>%
mutate(Q74_rafflemotivating = factor(Q74)) %>%
mutate(Q75_moving = factor(Q75_1)) %>%
mutate(Q59_canmaintainhealthysleephabits = factor(Q59_1)) %>%
mutate(Q59_cancutoutscreen = factor(Q59_2)) %>%
mutate(Q59_canexercise = factor(Q59_3)) %>%
mutate(Q59_canparticipateinbreathing = factor(Q59_4)) %>%
mutate(Q44_goodnightsleepisimportant = factor(Q44_1)) %>%
mutate(Q44_mentalclarity = factor(Q44_2)) %>%
mutate(Q44_feelpositive = factor(Q44_3)) %>%
mutate(Q44_cuttingoutscreenleadstobettersleep = factor(Q44_4)) %>%
mutate(Q44_exercisingleadstobettersleep = factor(Q44_5)) %>%
mutate(Q44_breathingexercisesleadstobettersleep = factor(Q44_6)) %>%
mutate(Q44_iwillstopscreens = factor(Q44_7)) %>%
mutate(Q44_iwillexercise = factor(Q44_8)) %>%
mutate(Q44_iwillbreathe = factor(Q44_9)) %>%
mutate(Q52_additionalcomments = factor(Q52))#Q85
resp.split_85 <- strsplit(sleephygiene$Q85, ",")
lev <- unique(unlist(resp.split_85))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_85, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q85_waystoimprovesleepquality = case_when(
Not.drinking.caffeinated.beverages.late.in.the.day == 1 ~ "Not drinking caffeinated beverages late in the day",
Switching.off.electronics.one.hour.before.sleep == 1 ~ "Switching off electronics one hour before sleep",
Incorporating.moderate.exercise.as.part.of.your.day == 1 ~ "Incorporating moderate exercise as part of your day",
Increase.natural.bright.light.exposure.in.the.day == 1 ~ "Increase natural bright light exposure in the day",
Reduce.irregular.or.long.daytime.naps == 1 ~ "Reduce irregular or long daytime naps",
Try.to.sleep.and.wake.at.consistent.times == 1 ~ "Try to sleep and wake at consistent times",
Take.a.melatonin.supplement == 1 ~ "Take a melatonin supplement",
Decrease.alcohol.consumption == 1 ~ "Decrease alcohol consumption",
Deep.breathing.exercises == 1 ~ "Deep breathing exercises"))
#Q83
resp.split_83 <- strsplit(sleephygiene$Q83, ",")
lev <- unique(unlist(resp.split_83))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_83, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q83_talkedtowho = case_when(
Friends == 1 ~ "Friends",
Spouse == 1 ~ "Spouse",
Relatives == 1 ~ "Relatives",
Colleague == 1 ~ "Colleague"))
#Q62
resp.split_62 <- strsplit(sleephygiene$Q62, ",")
lev <- unique(unlist(resp.split_62))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_62, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q62_howdidyouengage = case_when(
Instagram.campaign == 1 ~ "Instagram campaign",
Text.message.campaign == 1 ~ "Text message campaign",
Word.of.mouth.discussion.with.others == 1 ~ "Word of mouth/discussion with others"))
#64
resp.split_64 <- strsplit(sleephygiene$Q64, ",")
lev <- unique(unlist(resp.split_64))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_64, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q64_whichtechniquedidyoutry = case_when(
X.MoveMore == 1 ~ "Movemore",
X.Breathe== 1 ~ "Breathe",
X.PowerDown == 1 ~ "Powerdown",
None.of.the.above == 1 ~ "None of the above"))
#70
resp.split_70 <- strsplit(sleephygiene$Q70, ",")
lev <- unique(unlist(resp.split_70))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_70, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q70_timingoftextsinconvenient = case_when(
#Messages.were.too.frequent == 1 ~ "Messages were too frequent",
Messages.were.too.infrequent== 1 ~ "Messages were too infrequent",
Received.message.too.early.in.the.day == 1 ~ "Received message too early in the day",
#Received.message.too.late.in.the.day == 1 ~ "Received message too late in the day",
Other..please.explain.below. == 1 ~ "Other (please explain below)"))
#71
resp.split_71 <- strsplit(sleephygiene$Q71, ",")
lev <- unique(unlist(resp.split_71))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_71, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q71_whichchannelmosteducational = case_when(
Text == 1 ~ "Text",
Instagram == 1 ~ "Instagram"))
#Discussion.with.others.about.the.campaign == 1 ~ "Discussion with others about the campaign",
#None.of.the.above.1 == 1 ~ "None of the above"))
#72 - look into
#Q79
resp.split_79 <- strsplit(sleephygiene$Q79, ",")
lev <- unique(unlist(resp.split_79))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_79, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q79_moresuccessfuloutcomsuggestions = case_when(
There.was.an.in.person.on.campus.component.to.the.campaign == 1 ~ "There was an in-person/on-campus component to the campaign",
The.campaign.was.longer == 1 ~ "The campaign was longer",
I.had.more.flexibility.in.my.day == 1 ~ "I had more flexibility in my day",
There.were.subject.matter.experts.checking.in.with.me.one.on.one == 1 ~ "There were subject matter experts checking in with me one-on-one"))
#Other == 1 ~ "Reduce irregular or long daytime naps",
#Q73
resp.split_73 <- strsplit(sleephygiene$Q73, ",")
lev <- unique(unlist(resp.split_73))
sleephygiene<- with(sleephygiene, data.frame(sleephygiene, t(sapply(resp.split_73, function(x) table(factor(x, levels=lev))))))
sleephygiene <- sleephygiene %>%
mutate(Q73_hearabouthow = case_when(
Instagram.1 == 1 ~ "Instagram",
JHSPH.Activities.email == 1 ~ "JHSPH Activities email",
#Class.announcement == 1 ~ "Class announcement",
Word.of.mouth.discussion.with.others.1 == 1 ~ "Word of mouth/discussion with others"))
#Other == 1 ~ "Reduce irregular or long daytime naps",Plots for wakeup and sleep times
library(plotly)##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
workdayssleep <- sleephygiene %>% ggplot( aes(x=Q10_hoursofsleeplast5workdays)) +
geom_histogram( binwidth=1, fill="#69b3a2", color="#e9ecef", alpha=0.9) +
ggtitle("Hours of sleep last five workdays") +
theme(
text = element_text(size=30)
) +
#theme_test(text = element_text(size=40)) +
labs(x="Number of hours of sleep in the past five workdays", y="Number of participants") +
scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0), limits = c(0,65))
#workdayssleep
ggplotly(workdayssleep)## Warning: Removed 5 rows containing non-finite values (stat_bin).
#Plot for weekend
weekend <- sleephygiene %>% ggplot( aes(x=Q10_hoursofsleeppastweekend)) +
geom_histogram( binwidth=1, fill="#69b3a2", color="#e9ecef", alpha=0.9) +
ggtitle("Hours of sleep last weekend") +
theme(
text = element_text(size=30)
) +
labs(x="Number of hours of sleep in the past weekend", y="Number of participants") +
scale_x_continuous(expand = c(0, 0)) + scale_y_continuous(expand = c(0, 0), limits = c(0,60))
#weekend
ggplotly(weekend)## Warning: Removed 5 rows containing non-finite values (stat_bin).
#Tab 1
sleephygiene$Q9_howoftensleepypastmonth <- factor(sleephygiene$Q9_howoftensleepypastmonth, levels = c("Never", "Rarely", "Sometimes", "Very often", "Always"))
sleephygiene$Q61_howoftensleepypasttwoweeks <- factor(sleephygiene$Q61_howoftensleepypasttwoweeks, levels = c("Never", "Rarely", "Sometimes", "Very often", "Always"))
sleephygiene$Q89_ratesleepquality_notawareofcampaign <- factor(sleephygiene$Q89_ratesleepquality_notawareofcampaign, levels = c("Poor", "Fair", "Good", "Excellent"))
sleephygiene$Q75_moving <- factor(sleephygiene$Q75_moving, levels = c("Extremely unhelpful", "Somewhat unhelpful", "Neither helpful nor unhelpful", "Somewhat helpful", "Extremely helpful"))
sleephygiene$Q75_breathing <- factor(sleephygiene$Q75_breathing, levels = c("Extremely unhelpful", "Somewhat unhelpful", "Neither helpful nor unhelpful", "Somewhat helpful", "Extremely helpful"))
sleephygiene$Q75_powerdown <- factor(sleephygiene$Q75_powerdown, levels = c("Extremely unhelpful", "Somewhat unhelpful", "Neither helpful nor unhelpful", "Somewhat helpful", "Extremely helpful"))
sleephygiene$Q87_idealtime <- factor(sleephygiene$Q87_idealtime, levels = c("Early morning (6:00 am - 9:00 am)", "Late morning (9:01 am - 12:00 pm)", "Early afternoon (12:01 pm - 3:00 pm)", "Late afternoon (3:01 pm - 6:00 pm)", "Early evening (6:01 pm - 9:00 pm)", "Late evening (9:01 pm - 12:00 am)", "Other (please specify)"))
sleephygiene$Q59_canmaintainhealthysleephabits <- factor(sleephygiene$Q59_canmaintainhealthysleephabits, levels = c("Not at all confident", "Somewhat confident", "Extremely confident"))
sleephygiene$Q59_cancutoutscreen <- factor(sleephygiene$Q59_cancutoutscreen, levels = c("Not at all confident", "Somewhat confident", "Extremely confident"))
sleephygiene$Q59_canexercise <- factor(sleephygiene$Q59_canexercise, levels = c("Not at all confident", "Somewhat confident", "Extremely confident"))
sleephygiene$Q59_canparticipateinbreathing <- factor(sleephygiene$Q59_canparticipateinbreathing, levels = c("Not at all confident", "Somewhat confident", "Extremely confident"))
sleephygiene$Q44_goodnightsleepisimportant <- factor(sleephygiene$Q44_goodnightsleepisimportant, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_mentalclarity <- factor(sleephygiene$Q44_mentalclarity, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_feelpositive <- factor(sleephygiene$Q44_feelpositive, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_cuttingoutscreenleadstobettersleep <- factor(sleephygiene$Q44_cuttingoutscreenleadstobettersleep, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_exercisingleadstobettersleep <- factor(sleephygiene$Q44_exercisingleadstobettersleep, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_breathingexercisesleadstobettersleep <- factor(sleephygiene$Q44_breathingexercisesleadstobettersleep, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_iwillstopscreens <- factor(sleephygiene$Q44_iwillstopscreens, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_iwillexercise <- factor(sleephygiene$Q44_iwillexercise, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
sleephygiene$Q44_iwillbreathe <- factor(sleephygiene$Q44_iwillbreathe, levels = c("Strongly disagree", "Somewhat disagree", "Neither agree nor disagree", "Somewhat agree", "Strongly agree"))
library(expss)
sleephygiene = apply_labels(sleephygiene,
Q3_role = "What is your role at Bloomberg",
Q4_gender = "Which best describes your gender identity?",
Q2_program = "What is your current program at Bloomberg?",
Q5_age = "How old are you?",
Q6_numberinhousehold = "How many people live in your household, including yourself?",
Q37_employed = "If you are a student at Bloomberg, are you currently employed outside of your education program?",
Q92_notSPHemployed = "Are you currently employed?",
Q93_worksetting = "Which of the following best describes your current work setting?",
Q94_dayornight = "Do you work day or night shifts?",
Q38_worksetting = "Which of the following best describes your current work setting?",
Q39_dayornight = "Do you work day or night shifts?",
Q10_hoursofsleeplast5workdays = "On average, how many hours of sleep did you get per night during the following periods of time: during the last 5 workdays?",
Q10_hoursofsleeppastweekend = "On average, how many hours of sleep did you get per night during the following periods of time: during the past weekend?",
Q9_howoftensleepypastmonth = "How often did you feel sleepy during the day in the past month?",
Q61_howoftensleepypasttwoweeks = "How often did you feel sleepy during the day during the past 2 weeks?",
Q84_awareofhowtoimprovesleepquality = "Do you know any ways a person can improve their sleep quality?",
Q85_waystoimprovesleepquality = "What are some of the ways to improve sleep quality that you know?",
Q81_seenorheardfromGNbloombergcampaign = "In the last two-three weeks have you heard, seen, or received any information from the #GoodnightBloomberg campaign led by JHSPH students promoting better sleep?",
Q63_recalltoolsfreetect = "Can you recall any specific tools, techniques, or resources from the campaign? Please describe below.",
Q96_picture1 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 1",
Q96_picture2 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 2",
Q96_picture3 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 3",
Q96_picture4 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 4",
Q96_picture5 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 5",
Q96_picture6 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 6",
Q96_picture7 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 7",
Q96_picture8 = "Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 8",
Q95_talkedtoanyone = "Have you talked to anyone about the #GoodnightBloomberg campaign?",
Q83_talkedtowho = "Please indicate with whom you talked about #GoodnightBloomberg (check all that apply).",
Q82_knowanyonewhoengaged = "Do you know anyone who engaged in any way with the #GoodnightBloomberg campaign about promoting better sleep?",
Q69_didyouengagewiththecampaign = "Did you engage in any way with the #GoodnightBloomberg campaign led by JHSPH students during the past 2 weeks?",
Q62_howdidyouengage = "Please select which of the following parts of the #GoodnightBloomberg campaign you engaged in:",
Q64_whichtechniquedidyoutry = "Which of the following techniques did you try at least once in the last 2 weeks (choose all that apply)?",
Q90_areyouhappywithyoursleepquality_awareofcampaign = "Are you happy with your sleep quality overall currently?",
Q91_areyouhappywithyoursleepquality_notawareofcampaign = "Are you happy with your sleep quality overall currently?",
Q89_ratesleepquality_notawareofcampaign = "Please rate your sleep quality from the following options: In the last two weeks? (on average)",
Q67_move30minutes = "In the last two weeks, how many days did you participate in the following techniques? Move 30 minutes total per day",
Q67_breathing = "In the last two weeks, how many days did you participate in the following techniques? Use a breathing exercise",
Q67_powerdown = "In the last two weeks, how many days did you participate in the following techniques? Power down your screens (i.e. cell phone, tablet, computer, TV) 1 hour before bed",
Q75_moving = "How helpful did you find the following activities for getting better quality sleep in the past 2 weeks? Moving 30 minutes total per day",
Q75_breathing = "How helpful did you find the following activities for getting better quality sleep in the past 2 weeks? Using a breathing exercise",
Q75_powerdown = "How helpful did you find the following activities for getting better quality sleep in the past 2 weeks? Powering down your screens (i.e. cell phone, tablet, computer, TV) 1 hour before bed",
Q68_timing = "Was the timing of the texts/posts convenient for you to adopt the recommended activity? ",
Q70_timingoftextsinconvenient = "Please provide information below about why the timing of the texts/posts was inconvenient?",
Q87_idealtime = "What would have been the ideal time to receive the message (EST/EDT)?",
Q71_whichchannelmosteducational = "Which channel did you find the most educational?",
Q79_moresuccessfuloutcomsuggestions = "I think I would have had a more successful outcome (e.g. better sleep quality) if (choose all that may apply):",
Q74_rafflemotivating = "Did you find the raffles motivating for participation in the #GoodnightBloomberg campaign?",
Q73_hearabouthow = "How did you hear about the #GoodnightBloomberg campaign?",
Q59_canmaintainhealthysleephabits = "Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can maintain healthy sleep habits.",
Q59_cancutoutscreen = "Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can cut out screen use 1 hour before bed.",
Q59_canexercise = "Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can exercise for 30 minutes total each day.",
Q59_canparticipateinbreathing = "Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can participate in a breathing exercise during the day or before bed.",
Q44_goodnightsleepisimportant = "Please rate your agreement with the following statements: Getting a good night's sleep is important to me.",
Q44_mentalclarity = "Please rate your agreement with the following statements: Having a regular sleep routine improves mental clarity/sharpness.",
Q44_feelpositive = "Please rate your agreement with the following statements: I feel positive about the quality of my sleep.",
Q44_cuttingoutscreenleadstobettersleep = "Please rate your agreement with the following statements: I think cutting out screen use 1 hour before bed leads to better sleep.",
Q44_exercisingleadstobettersleep = "Please rate your agreement with the following statements: I think exercising regularly leads to better sleep.",
Q44_breathingexercisesleadstobettersleep = "Please rate your agreement with the following statements: I think participating in breathing exercises during the day or before bed leads to better sleep.",
Q44_iwillstopscreens = "Please rate your agreement with the following statements: In the next two weeks, I will stop using screens 1 hour before bed for better sleep.",
Q44_iwillexercise = "Please rate your agreement with the following statements: In the next two weeks, I will exercise for at least 30 minutes total each day for better sleep.",
Q44_iwillbreathe = "Please rate your agreement with the following statements: In the next two weeks, I will do a daily breathing exercise for better sleep.",
Q52_additionalcomments = "Please share any additional comments or feedback you have about the #GoodnightBloomberg sleep campaign below."
)attach(sleephygiene)
tab1 <- tableby(~ Q3_role +
Q4_gender +
Q5_age +
Q6_numberinhousehold +
Q37_employed +
Q10_hoursofsleeplast5workdays +
Q10_hoursofsleeppastweekend +
Q9_howoftensleepypastmonth +
Q61_howoftensleepypasttwoweeks +
Q84_awareofhowtoimprovesleepquality +
Q81_seenorheardfromGNbloombergcampaign +
#Q63_recalltoolsfreetect +
Q96_picture1 +
Q96_picture2 +
Q96_picture3 +
Q96_picture4 +
Q96_picture5 +
Q96_picture6 +
Q96_picture7 +
Q96_picture8 +
Q95_talkedtoanyone +
Q82_knowanyonewhoengaged +
Q69_didyouengagewiththecampaign +
Q67_move30minutes +
Q67_breathing +
Q67_powerdown +
Q68_timing +
Q79_moresuccessfuloutcomsuggestions +
Q59_canmaintainhealthysleephabits +
Q59_cancutoutscreen +
Q59_canexercise +
Q59_canparticipateinbreathing +
Q44_goodnightsleepisimportant +
Q44_mentalclarity +
Q44_feelpositive +
Q44_cuttingoutscreenleadstobettersleep +
Q44_exercisingleadstobettersleep +
Q44_breathingexercisesleadstobettersleep +
Q44_iwillstopscreens +
Q44_iwillexercise +
Q44_iwillbreathe,
data=sleephygiene, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab1, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=157) | |
|---|---|
| What is your role at Bloomberg | |
| N-Miss | 4 |
| Faculty/Staff Member | 10 (6.5%) |
| Full-time student | 86 (56.2%) |
| Not affiliated with Bloomberg School of Public Health | 2 (1.3%) |
| Part-time student | 55 (35.9%) |
| Which best describes your gender identity? | |
| N-Miss | 4 |
| Female | 127 (83.0%) |
| Male | 25 (16.3%) |
| Non-binary / third gender | 1 (0.7%) |
| How old are you? | |
| N-Miss | 4 |
| 18-25 | 45 (29.4%) |
| 26-34 | 67 (43.8%) |
| 35-44 | 26 (17.0%) |
| 45-54 | 13 (8.5%) |
| 55-64 | 1 (0.7%) |
| 64-75 | 1 (0.7%) |
| How many people live in your household, including yourself? | |
| Median (Q1, Q3) | 2.00 (2.00, 3.00) |
| If you are a student at Bloomberg, are you currently employed outside of your education program? | |
| N-Miss | 4 |
| N/A - I am not a student at Bloomberg | 11 (7.2%) |
| No | 67 (43.8%) |
| Yes | 75 (49.0%) |
| On average, how many hours of sleep did you get per night during the following periods of time: during the last 5 workdays? | |
| Median (Q1, Q3) | 7.00 (6.00, 7.00) |
| On average, how many hours of sleep did you get per night during the following periods of time: during the past weekend? | |
| Median (Q1, Q3) | 8.00 (7.00, 8.00) |
| How often did you feel sleepy during the day in the past month? | |
| N-Miss | 60 |
| Never | 3 (3.1%) |
| Rarely | 16 (16.5%) |
| Sometimes | 67 (69.1%) |
| Very often | 0 (0.0%) |
| Always | 11 (11.3%) |
| How often did you feel sleepy during the day during the past 2 weeks? | |
| N-Miss | 57 |
| Never | 2 (2.0%) |
| Rarely | 25 (25.0%) |
| Sometimes | 56 (56.0%) |
| Very often | 0 (0.0%) |
| Always | 17 (17.0%) |
| Do you know any ways a person can improve their sleep quality? | |
| N-Miss | 12 |
| No | 7 (4.8%) |
| Yes | 138 (95.2%) |
| In the last two-three weeks have you heard, seen, or received any information from the #GoodnightBloomberg campaign led by JHSPH students promoting better sleep? | |
| N-Miss | 12 |
| Don’t know | 33 (22.8%) |
| No | 57 (39.3%) |
| Yes | 55 (37.9%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 1 | |
| N-Miss | 29 |
| No | 24 (18.8%) |
| Not sure | 98 (76.6%) |
| Yes | 6 (4.7%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 2 | |
| N-Miss | 24 |
| No | 7 (5.3%) |
| Not sure | 76 (57.1%) |
| Yes | 50 (37.6%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 3 | |
| N-Miss | 28 |
| No | 21 (16.3%) |
| Not sure | 101 (78.3%) |
| Yes | 7 (5.4%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 4 | |
| N-Miss | 29 |
| No | 18 (14.1%) |
| Not sure | 98 (76.6%) |
| Yes | 12 (9.4%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 5 | |
| N-Miss | 27 |
| No | 14 (10.8%) |
| Not sure | 97 (74.6%) |
| Yes | 19 (14.6%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 6 | |
| N-Miss | 27 |
| No | 20 (15.4%) |
| Not sure | 106 (81.5%) |
| Yes | 4 (3.1%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 7 | |
| N-Miss | 27 |
| No | 17 (13.1%) |
| Not sure | 100 (76.9%) |
| Yes | 13 (10.0%) |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 8 | |
| N-Miss | 28 |
| No | 19 (14.7%) |
| Not sure | 104 (80.6%) |
| Yes | 6 (4.7%) |
| Have you talked to anyone about the #GoodnightBloomberg campaign? | |
| N-Miss | 12 |
| No | 132 (91.0%) |
| Yes | 13 (9.0%) |
| Do you know anyone who engaged in any way with the #GoodnightBloomberg campaign about promoting better sleep? | |
| N-Miss | 12 |
| No | 135 (93.1%) |
| Yes | 10 (6.9%) |
| Did you engage in any way with the #GoodnightBloomberg campaign led by JHSPH students during the past 2 weeks? | |
| N-Miss | 12 |
| No | 120 (82.8%) |
| Yes | 25 (17.2%) |
| In the last two weeks, how many days did you participate in the following techniques? Move 30 minutes total per day | |
| Median (Q1, Q3) | 8.50 (5.00, 12.00) |
| In the last two weeks, how many days did you participate in the following techniques? Use a breathing exercise | |
| Median (Q1, Q3) | 2.00 (1.00, 6.00) |
| In the last two weeks, how many days did you participate in the following techniques? Power down your screens (i.e. cell phone, tablet, computer, TV) 1 hour before bed | |
| Median (Q1, Q3) | 2.00 (1.00, 6.00) |
| Was the timing of the texts/posts convenient for you to adopt the recommended activity? | |
| N-Miss | 41 |
| No | 54 (46.6%) |
| Yes | 62 (53.4%) |
| I think I would have had a more successful outcome (e.g. better sleep quality) if (choose all that may apply): | |
| N-Miss | 55 |
| I had more flexibility in my day | 42 (41.2%) |
| The campaign was longer | 24 (23.5%) |
| There was an in-person/on-campus component to the campaign | 25 (24.5%) |
| There were subject matter experts checking in with me one-on-one | 11 (10.8%) |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can maintain healthy sleep habits. | |
| N-Miss | 14 |
| Not at all confident | 26 (18.2%) |
| Somewhat confident | 87 (60.8%) |
| Extremely confident | 30 (21.0%) |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can cut out screen use 1 hour before bed. | |
| N-Miss | 14 |
| Not at all confident | 70 (49.0%) |
| Somewhat confident | 54 (37.8%) |
| Extremely confident | 19 (13.3%) |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can exercise for 30 minutes total each day. | |
| N-Miss | 14 |
| Not at all confident | 18 (12.6%) |
| Somewhat confident | 62 (43.4%) |
| Extremely confident | 63 (44.1%) |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can participate in a breathing exercise during the day or before bed. | |
| N-Miss | 14 |
| Not at all confident | 17 (11.9%) |
| Somewhat confident | 76 (53.1%) |
| Extremely confident | 50 (35.0%) |
| Please rate your agreement with the following statements: Getting a good night’s sleep is important to me. | |
| N-Miss | 14 |
| Strongly disagree | 0 (0.0%) |
| Somewhat disagree | 1 (0.7%) |
| Neither agree nor disagree | 1 (0.7%) |
| Somewhat agree | 25 (17.5%) |
| Strongly agree | 116 (81.1%) |
| Please rate your agreement with the following statements: Having a regular sleep routine improves mental clarity/sharpness. | |
| N-Miss | 14 |
| Strongly disagree | 0 (0.0%) |
| Somewhat disagree | 1 (0.7%) |
| Neither agree nor disagree | 0 (0.0%) |
| Somewhat agree | 23 (16.1%) |
| Strongly agree | 119 (83.2%) |
| Please rate your agreement with the following statements: I feel positive about the quality of my sleep. | |
| N-Miss | 14 |
| Strongly disagree | 11 (7.7%) |
| Somewhat disagree | 33 (23.1%) |
| Neither agree nor disagree | 24 (16.8%) |
| Somewhat agree | 52 (36.4%) |
| Strongly agree | 23 (16.1%) |
| Please rate your agreement with the following statements: I think cutting out screen use 1 hour before bed leads to better sleep. | |
| N-Miss | 13 |
| Strongly disagree | 1 (0.7%) |
| Somewhat disagree | 5 (3.5%) |
| Neither agree nor disagree | 19 (13.2%) |
| Somewhat agree | 50 (34.7%) |
| Strongly agree | 69 (47.9%) |
| Please rate your agreement with the following statements: I think exercising regularly leads to better sleep. | |
| N-Miss | 13 |
| Strongly disagree | 0 (0.0%) |
| Somewhat disagree | 2 (1.4%) |
| Neither agree nor disagree | 5 (3.5%) |
| Somewhat agree | 40 (27.8%) |
| Strongly agree | 97 (67.4%) |
| Please rate your agreement with the following statements: I think participating in breathing exercises during the day or before bed leads to better sleep. | |
| N-Miss | 13 |
| Strongly disagree | 0 (0.0%) |
| Somewhat disagree | 5 (3.5%) |
| Neither agree nor disagree | 36 (25.0%) |
| Somewhat agree | 58 (40.3%) |
| Strongly agree | 45 (31.2%) |
| Please rate your agreement with the following statements: In the next two weeks, I will stop using screens 1 hour before bed for better sleep. | |
| N-Miss | 15 |
| Strongly disagree | 27 (19.0%) |
| Somewhat disagree | 27 (19.0%) |
| Neither agree nor disagree | 28 (19.7%) |
| Somewhat agree | 41 (28.9%) |
| Strongly agree | 19 (13.4%) |
| Please rate your agreement with the following statements: In the next two weeks, I will exercise for at least 30 minutes total each day for better sleep. | |
| N-Miss | 14 |
| Strongly disagree | 3 (2.1%) |
| Somewhat disagree | 8 (5.6%) |
| Neither agree nor disagree | 17 (11.9%) |
| Somewhat agree | 50 (35.0%) |
| Strongly agree | 65 (45.5%) |
| Please rate your agreement with the following statements: In the next two weeks, I will do a daily breathing exercise for better sleep. | |
| N-Miss | 14 |
| Strongly disagree | 12 (8.4%) |
| Somewhat disagree | 21 (14.7%) |
| Neither agree nor disagree | 26 (18.2%) |
| Somewhat agree | 56 (39.2%) |
| Strongly agree | 28 (19.6%) |
#If student
student <- sleephygiene %>% filter(Q3_role %in% c("Part-time student", "Full-time student"))
tab2 <- tableby(~ Q2_program,
data=student, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab2, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=141) | |
|---|---|
| What is your current program at Bloomberg? | |
| Doctoral Student | 31 (22.0%) |
| Masters Student | 94 (66.7%) |
| Other | 6 (4.3%) |
| Post-doctoral student | 10 (7.1%) |
#If employed
nonbloombergstudentemployed <- sleephygiene %>% filter(Q37_employed == "N/A - I am not a student at Bloomberg")
tab3 <- tableby(~ Q92_notSPHemployed,
data=nonbloombergstudentemployed, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab3, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=11) | |
|---|---|
| Are you currently employed? | |
| No | 1 (9.1%) |
| Yes | 10 (90.9%) |
#If employed and not bloomberg
employed <- nonbloombergstudentemployed %>% filter(Q92_notSPHemployed == "Yes")
tab4 <- tableby(~ Q93_worksetting,
data=employed, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab4, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=10) | |
|---|---|
| Which of the following best describes your current work setting? | |
| I sometimes work at home and sometimes at another location | 3 (30.0%) |
| I work from home | 6 (60.0%) |
| I work in a location away from my home | 1 (10.0%) |
#wfh not bloomberg
#wfhnotbloomberg <- nonbloombergstudentemployed %>% filter(Q93_worksetting == "I work in a location away from my home")
#tab5 <- tableby(~ Q94_dayornight,
# data=wfhnotbloomberg, test=TRUE, total=TRUE,
# numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
#summary(tab5, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)
#student at bloomberg
studentemployed <- student %>% filter(Q37_employed == "Yes")
tab6 <- tableby(~ Q38_worksetting,
data=studentemployed, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab6, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=75) | |
|---|---|
| Which of the following best describes your current work setting? | |
| N-Miss | 2 |
| I sometimes work at home and sometimes at another location | 18 (24.7%) |
| I work from home | 42 (57.5%) |
| I work in a location away from my home | 13 (17.8%) |
studentemployedlocation <- student %>% filter(Q39_dayornight == "I work in a location away from my home")
#tab7 <- tableby(~ Q39_dayornight,
# data=studentemployedlocation, test=TRUE, total=TRUE,
# numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
#summary(tab7, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)
#Aware of how to improve sleep quality
awareofsleepqualityimprovements <- sleephygiene %>% filter(Q84_awareofhowtoimprovesleepquality == "Yes")
tab8 <- tableby(~ Q85_waystoimprovesleepquality,
data=awareofsleepqualityimprovements, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab8, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=138) | |
|---|---|
| What are some of the ways to improve sleep quality that you know? | |
| N-Miss | 1 |
| Not drinking caffeinated beverages late in the day | 128 (93.4%) |
| Reduce irregular or long daytime naps | 1 (0.7%) |
| Switching off electronics one hour before sleep | 7 (5.1%) |
| Try to sleep and wake at consistent times | 1 (0.7%) |
#Talked to someone
talkedtosomeone <- sleephygiene %>% filter(Q95_talkedtoanyone == "Yes")
tab9 <- tableby(~ Q83_talkedtowho,
data=talkedtosomeone, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab9, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=13) | |
|---|---|
| Please indicate with whom you talked about #GoodnightBloomberg (check all that apply). | |
| N-Miss | 1 |
| Colleague | 1 (8.3%) |
| Friends | 9 (75.0%) |
| Spouse | 2 (16.7%) |
#engaged in any way
engagedwiththecampaign <- sleephygiene %>% filter(Q69_didyouengagewiththecampaign == "Yes")
tab10 <- tableby(~ Q62_howdidyouengage +
Q64_whichtechniquedidyoutry +
Q90_areyouhappywithyoursleepquality_awareofcampaign +
Q75_moving +
Q75_breathing +
Q75_powerdown,
data=engagedwiththecampaign, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab10, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=25) | |
|---|---|
| Please select which of the following parts of the #GoodnightBloomberg campaign you engaged in: | |
| N-Miss | 1 |
| Instagram campaign | 15 (62.5%) |
| Text message campaign | 8 (33.3%) |
| Word of mouth/discussion with others | 1 (4.2%) |
| Which of the following techniques did you try at least once in the last 2 weeks (choose all that apply)? | |
| Breathe | 5 (20.0%) |
| Movemore | 15 (60.0%) |
| None of the above | 2 (8.0%) |
| Powerdown | 3 (12.0%) |
| Are you happy with your sleep quality overall currently? | |
| N-Miss | 1 |
| No | 10 (41.7%) |
| Yes | 14 (58.3%) |
| How helpful did you find the following activities for getting better quality sleep in the past 2 weeks? Moving 30 minutes total per day | |
| N-Miss | 8 |
| Extremely unhelpful | 0 (0.0%) |
| Somewhat unhelpful | 0 (0.0%) |
| Neither helpful nor unhelpful | 0 (0.0%) |
| Somewhat helpful | 13 (76.5%) |
| Extremely helpful | 4 (23.5%) |
| How helpful did you find the following activities for getting better quality sleep in the past 2 weeks? Using a breathing exercise | |
| N-Miss | 12 |
| Extremely unhelpful | 0 (0.0%) |
| Somewhat unhelpful | 0 (0.0%) |
| Neither helpful nor unhelpful | 7 (53.8%) |
| Somewhat helpful | 4 (30.8%) |
| Extremely helpful | 2 (15.4%) |
| How helpful did you find the following activities for getting better quality sleep in the past 2 weeks? Powering down your screens (i.e. cell phone, tablet, computer, TV) 1 hour before bed | |
| N-Miss | 16 |
| Extremely unhelpful | 0 (0.0%) |
| Somewhat unhelpful | 0 (0.0%) |
| Neither helpful nor unhelpful | 2 (22.2%) |
| Somewhat helpful | 5 (55.6%) |
| Extremely helpful | 2 (22.2%) |
#did not engagee in any way
noengagementwiththecampagin <- sleephygiene %>% filter(Q69_didyouengagewiththecampaign %in% c("No", "Don't know"))
tab11 <- tableby(~ Q91_areyouhappywithyoursleepquality_notawareofcampaign +
Q89_ratesleepquality_notawareofcampaign,
data=noengagementwiththecampagin, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab11, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=120) | |
|---|---|
| Are you happy with your sleep quality overall currently? | |
| N-Miss | 33 |
| No | 52 (59.8%) |
| Yes | 35 (40.2%) |
| Please rate your sleep quality from the following options: In the last two weeks? (on average) | |
| N-Miss | 31 |
| Poor | 9 (10.1%) |
| Fair | 38 (42.7%) |
| Good | 37 (41.6%) |
| Excellent | 5 (5.6%) |
#not convenient
notconvenient <- sleephygiene %>% filter(Q68_timing == "No")
tab12 <- tableby(~ Q70_timingoftextsinconvenient,
data=noengagementwiththecampagin, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab12, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=120) | |
|---|---|
| Please provide information below about why the timing of the texts/posts was inconvenient? | |
| N-Miss | 87 |
| Messages were too infrequent | 5 (15.2%) |
| Other (please explain below) | 27 (81.8%) |
| Received message too early in the day | 1 (3.0%) |
#tooearlyintheday
tooearlyortoolate <- notconvenient %>% filter(Q70_timingoftextsinconvenient %in% c("Received message too early in the day", "Received message too late in the day"))
tab13 <- tableby(~ Q87_idealtime,
data=tooearlyortoolate, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab13, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=3) | |
|---|---|
| What would have been the ideal time to receive the message (EST/EDT)? | |
| Early morning (6:00 am - 9:00 am) | 0 (0.0%) |
| Late morning (9:01 am - 12:00 pm) | 1 (33.3%) |
| Early afternoon (12:01 pm - 3:00 pm) | 0 (0.0%) |
| Late afternoon (3:01 pm - 6:00 pm) | 0 (0.0%) |
| Early evening (6:01 pm - 9:00 pm) | 2 (66.7%) |
| Late evening (9:01 pm - 12:00 am) | 0 (0.0%) |
| Other (please specify) | 0 (0.0%) |
#whichmosteducational
instagramortext <- engagedwiththecampaign %>% filter(Q62_howdidyouengage %in% c("Instagram", "Text message campaign"))
#tab14 <- tableby(~ Q71_whichchannelmosteducational +
# Q72,
# data=instagramortext, test=TRUE, total=TRUE,
# numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
#summary(tab14, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)
#instagram
instagram <- engagedwiththecampaign %>% filter(Q62_howdidyouengage == "Instagram campaign")
tab15 <- tableby(~ Q74_rafflemotivating,
data=instagram, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab15, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=15) | |
|---|---|
| Did you find the raffles motivating for participation in the #GoodnightBloomberg campaign? | |
| No | 4 (26.7%) |
| Yes | 11 (73.3%) |
#seenorheardofthecampiagn
seenordheard <- sleephygiene %>% filter(Q81_seenorheardfromGNbloombergcampaign == "Yes")
tab16 <- tableby(~ Q81_seenorheardfromGNbloombergcampaign,
data=seenordheard, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab16, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| Overall (N=55) | |
|---|---|
| In the last two-three weeks have you heard, seen, or received any information from the #GoodnightBloomberg campaign led by JHSPH students promoting better sleep? | |
| Don’t know | 0 (0.0%) |
| No | 0 (0.0%) |
| Yes | 55 (100.0%) |
sleephygiene <- sleephygiene %>% mutate(Engagementyesno = case_when(
Q69_didyouengagewiththecampaign == "Yes" ~ 1,
Q69_didyouengagewiththecampaign == "No" ~ 0,
Q69_didyouengagewiththecampaign == "Don't know" ~ 0,
is.na(Q69_didyouengagewiththecampaign) ~ NA_real_)) %>%
mutate(Engagementyesno = factor(Engagementyesno))
tab1 <- tableby(Engagementyesno ~ Q3_role +
Q4_gender +
Q5_age +
Q6_numberinhousehold +
Q37_employed +
Q10_hoursofsleeplast5workdays +
Q10_hoursofsleeppastweekend +
Q9_howoftensleepypastmonth +
Q61_howoftensleepypasttwoweeks +
Q84_awareofhowtoimprovesleepquality +
Q81_seenorheardfromGNbloombergcampaign +
Q96_picture1 +
Q96_picture2 +
Q96_picture3 +
Q96_picture4 +
Q96_picture5 +
Q96_picture6 +
Q96_picture7 +
Q96_picture8 +
Q95_talkedtoanyone +
Q82_knowanyonewhoengaged +
Q69_didyouengagewiththecampaign +
Q67_move30minutes +
Q67_breathing +
Q67_powerdown +
Q68_timing +
Q79_moresuccessfuloutcomsuggestions +
Q59_canmaintainhealthysleephabits +
Q59_cancutoutscreen +
Q59_canexercise +
Q59_canparticipateinbreathing +
Q44_goodnightsleepisimportant +
Q44_mentalclarity +
Q44_feelpositive +
Q44_cuttingoutscreenleadstobettersleep +
Q44_exercisingleadstobettersleep +
Q44_breathingexercisesleadstobettersleep +
Q44_iwillstopscreens +
Q44_iwillexercise +
Q44_iwillbreathe,
data=sleephygiene, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab1, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| 0 (N=120) | 1 (N=25) | Total (N=145) | p value | |
|---|---|---|---|---|
| What is your role at Bloomberg | ||||
| N-Miss | 0 | 2 | 2 | |
| Faculty/Staff Member | 9 (7.5%) | 0 (0.0%) | 9 (6.3%) | |
| Full-time student | 66 (55.0%) | 16 (69.6%) | 82 (57.3%) | |
| Not affiliated with Bloomberg School of Public Health | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Part-time student | 45 (37.5%) | 7 (30.4%) | 52 (36.4%) | |
| Which best describes your gender identity? | 0.5581 | |||
| N-Miss | 0 | 2 | 2 | |
| Female | 99 (82.5%) | 21 (91.3%) | 120 (83.9%) | |
| Male | 20 (16.7%) | 2 (8.7%) | 22 (15.4%) | |
| Non-binary / third gender | 1 (0.8%) | 0 (0.0%) | 1 (0.7%) | |
| How old are you? | 0.9951 | |||
| N-Miss | 0 | 2 | 2 | |
| 18-25 | 37 (30.8%) | 7 (30.4%) | 44 (30.8%) | |
| 26-34 | 52 (43.3%) | 10 (43.5%) | 62 (43.4%) | |
| 35-44 | 19 (15.8%) | 4 (17.4%) | 23 (16.1%) | |
| 45-54 | 10 (8.3%) | 2 (8.7%) | 12 (8.4%) | |
| 55-64 | 1 (0.8%) | 0 (0.0%) | 1 (0.7%) | |
| 64-75 | 1 (0.8%) | 0 (0.0%) | 1 (0.7%) | |
| How many people live in your household, including yourself? | 0.0112 | |||
| Median (Q1, Q3) | 2.00 (1.00, 3.00) | 3.00 (2.00, 4.00) | 2.00 (2.00, 3.00) | |
| If you are a student at Bloomberg, are you currently employed outside of your education program? | 0.0261 | |||
| N-Miss | 0 | 2 | 2 | |
| N/A - I am not a student at Bloomberg | 8 (6.7%) | 0 (0.0%) | 8 (5.6%) | |
| No | 59 (49.2%) | 6 (26.1%) | 65 (45.5%) | |
| Yes | 53 (44.2%) | 17 (73.9%) | 70 (49.0%) | |
| On average, how many hours of sleep did you get per night during the following periods of time: during the last 5 workdays? | 0.7282 | |||
| Median (Q1, Q3) | 7.00 (6.00, 7.00) | 7.00 (6.00, 8.00) | 7.00 (6.00, 7.00) | |
| On average, how many hours of sleep did you get per night during the following periods of time: during the past weekend? | 0.1742 | |||
| Median (Q1, Q3) | 8.00 (7.00, 8.00) | 8.00 (7.00, 9.00) | 8.00 (7.00, 8.00) | |
| How often did you feel sleepy during the day in the past month? | ||||
| N-Miss | 44 | 10 | 54 | |
| Never | 3 (3.9%) | 0 (0.0%) | 3 (3.3%) | |
| Rarely | 10 (13.2%) | 3 (20.0%) | 13 (14.3%) | |
| Sometimes | 56 (73.7%) | 10 (66.7%) | 66 (72.5%) | |
| Very often | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Always | 7 (9.2%) | 2 (13.3%) | 9 (9.9%) | |
| How often did you feel sleepy during the day during the past 2 weeks? | ||||
| N-Miss | 42 | 9 | 51 | |
| Never | 2 (2.6%) | 0 (0.0%) | 2 (2.1%) | |
| Rarely | 17 (21.8%) | 5 (31.2%) | 22 (23.4%) | |
| Sometimes | 46 (59.0%) | 9 (56.2%) | 55 (58.5%) | |
| Very often | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Always | 13 (16.7%) | 2 (12.5%) | 15 (16.0%) | |
| Do you know any ways a person can improve their sleep quality? | 0.2161 | |||
| No | 7 (5.8%) | 0 (0.0%) | 7 (4.8%) | |
| Yes | 113 (94.2%) | 25 (100.0%) | 138 (95.2%) | |
| In the last two-three weeks have you heard, seen, or received any information from the #GoodnightBloomberg campaign led by JHSPH students promoting better sleep? | < 0.0011 | |||
| Don’t know | 32 (26.7%) | 1 (4.0%) | 33 (22.8%) | |
| No | 57 (47.5%) | 0 (0.0%) | 57 (39.3%) | |
| Yes | 31 (25.8%) | 24 (96.0%) | 55 (37.9%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 1 | < 0.0011 | |||
| N-Miss | 14 | 3 | 17 | |
| No | 13 (12.3%) | 11 (50.0%) | 24 (18.8%) | |
| Not sure | 89 (84.0%) | 9 (40.9%) | 98 (76.6%) | |
| Yes | 4 (3.8%) | 2 (9.1%) | 6 (4.7%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 2 | < 0.0011 | |||
| N-Miss | 11 | 1 | 12 | |
| No | 7 (6.4%) | 0 (0.0%) | 7 (5.3%) | |
| Not sure | 74 (67.9%) | 2 (8.3%) | 76 (57.1%) | |
| Yes | 28 (25.7%) | 22 (91.7%) | 50 (37.6%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 3 | < 0.0011 | |||
| N-Miss | 13 | 3 | 16 | |
| No | 13 (12.1%) | 8 (36.4%) | 21 (16.3%) | |
| Not sure | 92 (86.0%) | 9 (40.9%) | 101 (78.3%) | |
| Yes | 2 (1.9%) | 5 (22.7%) | 7 (5.4%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 4 | < 0.0011 | |||
| N-Miss | 14 | 3 | 17 | |
| No | 11 (10.4%) | 7 (31.8%) | 18 (14.1%) | |
| Not sure | 88 (83.0%) | 10 (45.5%) | 98 (76.6%) | |
| Yes | 7 (6.6%) | 5 (22.7%) | 12 (9.4%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 5 | < 0.0011 | |||
| N-Miss | 13 | 2 | 15 | |
| No | 11 (10.3%) | 3 (13.0%) | 14 (10.8%) | |
| Not sure | 90 (84.1%) | 7 (30.4%) | 97 (74.6%) | |
| Yes | 6 (5.6%) | 13 (56.5%) | 19 (14.6%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 6 | 0.0371 | |||
| N-Miss | 12 | 3 | 15 | |
| No | 14 (13.0%) | 6 (27.3%) | 20 (15.4%) | |
| Not sure | 92 (85.2%) | 14 (63.6%) | 106 (81.5%) | |
| Yes | 2 (1.9%) | 2 (9.1%) | 4 (3.1%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 7 | < 0.0011 | |||
| N-Miss | 13 | 2 | 15 | |
| No | 14 (13.1%) | 3 (13.0%) | 17 (13.1%) | |
| Not sure | 90 (84.1%) | 10 (43.5%) | 100 (76.9%) | |
| Yes | 3 (2.8%) | 10 (43.5%) | 13 (10.0%) | |
| Were these materials were utilized in our #GoodnightBloomberg campaign? Picture 8 | 0.0011 | |||
| N-Miss | 13 | 3 | 16 | |
| No | 14 (13.1%) | 5 (22.7%) | 19 (14.7%) | |
| Not sure | 91 (85.0%) | 13 (59.1%) | 104 (80.6%) | |
| Yes | 2 (1.9%) | 4 (18.2%) | 6 (4.7%) | |
| Have you talked to anyone about the #GoodnightBloomberg campaign? | < 0.0011 | |||
| No | 118 (98.3%) | 14 (56.0%) | 132 (91.0%) | |
| Yes | 2 (1.7%) | 11 (44.0%) | 13 (9.0%) | |
| Do you know anyone who engaged in any way with the #GoodnightBloomberg campaign about promoting better sleep? | < 0.0011 | |||
| No | 116 (96.7%) | 19 (76.0%) | 135 (93.1%) | |
| Yes | 4 (3.3%) | 6 (24.0%) | 10 (6.9%) | |
| Did you engage in any way with the #GoodnightBloomberg campaign led by JHSPH students during the past 2 weeks? | < 0.0011 | |||
| No | 120 (100.0%) | 0 (0.0%) | 120 (82.8%) | |
| Yes | 0 (0.0%) | 25 (100.0%) | 25 (17.2%) | |
| In the last two weeks, how many days did you participate in the following techniques? Move 30 minutes total per day | 0.2902 | |||
| Median (Q1, Q3) | 9.00 (5.00, 12.00) | 8.00 (4.00, 10.00) | 8.50 (5.00, 12.00) | |
| In the last two weeks, how many days did you participate in the following techniques? Use a breathing exercise | 0.4092 | |||
| Median (Q1, Q3) | 2.00 (1.00, 6.00) | 3.00 (2.00, 6.00) | 2.00 (1.00, 6.00) | |
| In the last two weeks, how many days did you participate in the following techniques? Power down your screens (i.e. cell phone, tablet, computer, TV) 1 hour before bed | 0.4092 | |||
| Median (Q1, Q3) | 2.00 (1.00, 6.00) | 3.00 (2.00, 6.00) | 2.00 (1.00, 6.00) | |
| Was the timing of the texts/posts convenient for you to adopt the recommended activity? | 0.0441 | |||
| N-Miss | 26 | 3 | 29 | |
| No | 48 (51.1%) | 6 (27.3%) | 54 (46.6%) | |
| Yes | 46 (48.9%) | 16 (72.7%) | 62 (53.4%) | |
| I think I would have had a more successful outcome (e.g. better sleep quality) if (choose all that may apply): | 0.0471 | |||
| N-Miss | 42 | 1 | 43 | |
| I had more flexibility in my day | 36 (46.2%) | 6 (25.0%) | 42 (41.2%) | |
| The campaign was longer | 14 (17.9%) | 10 (41.7%) | 24 (23.5%) | |
| There was an in-person/on-campus component to the campaign | 18 (23.1%) | 7 (29.2%) | 25 (24.5%) | |
| There were subject matter experts checking in with me one-on-one | 10 (12.8%) | 1 (4.2%) | 11 (10.8%) | |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can maintain healthy sleep habits. | 0.3461 | |||
| N-Miss | 0 | 2 | 2 | |
| Not at all confident | 21 (17.5%) | 5 (21.7%) | 26 (18.2%) | |
| Somewhat confident | 76 (63.3%) | 11 (47.8%) | 87 (60.8%) | |
| Extremely confident | 23 (19.2%) | 7 (30.4%) | 30 (21.0%) | |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can cut out screen use 1 hour before bed. | 0.4451 | |||
| N-Miss | 0 | 2 | 2 | |
| Not at all confident | 56 (46.7%) | 14 (60.9%) | 70 (49.0%) | |
| Somewhat confident | 47 (39.2%) | 7 (30.4%) | 54 (37.8%) | |
| Extremely confident | 17 (14.2%) | 2 (8.7%) | 19 (13.3%) | |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can exercise for 30 minutes total each day. | 0.3741 | |||
| N-Miss | 0 | 2 | 2 | |
| Not at all confident | 14 (11.7%) | 4 (17.4%) | 18 (12.6%) | |
| Somewhat confident | 55 (45.8%) | 7 (30.4%) | 62 (43.4%) | |
| Extremely confident | 51 (42.5%) | 12 (52.2%) | 63 (44.1%) | |
| Please tell us how confident you feel practicing the following behaviors in order to get better sleep: I can participate in a breathing exercise during the day or before bed. | 0.8331 | |||
| N-Miss | 1 | 1 | 2 | |
| Not at all confident | 15 (12.6%) | 2 (8.3%) | 17 (11.9%) | |
| Somewhat confident | 63 (52.9%) | 13 (54.2%) | 76 (53.1%) | |
| Extremely confident | 41 (34.5%) | 9 (37.5%) | 50 (35.0%) | |
| Please rate your agreement with the following statements: Getting a good night’s sleep is important to me. | ||||
| N-Miss | 0 | 2 | 2 | |
| Strongly disagree | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Somewhat disagree | 1 (0.8%) | 0 (0.0%) | 1 (0.7%) | |
| Neither agree nor disagree | 1 (0.8%) | 0 (0.0%) | 1 (0.7%) | |
| Somewhat agree | 23 (19.2%) | 2 (8.7%) | 25 (17.5%) | |
| Strongly agree | 95 (79.2%) | 21 (91.3%) | 116 (81.1%) | |
| Please rate your agreement with the following statements: Having a regular sleep routine improves mental clarity/sharpness. | ||||
| N-Miss | 1 | 1 | 2 | |
| Strongly disagree | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Somewhat disagree | 1 (0.8%) | 0 (0.0%) | 1 (0.7%) | |
| Neither agree nor disagree | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Somewhat agree | 18 (15.1%) | 5 (20.8%) | 23 (16.1%) | |
| Strongly agree | 100 (84.0%) | 19 (79.2%) | 119 (83.2%) | |
| Please rate your agreement with the following statements: I feel positive about the quality of my sleep. | 0.9351 | |||
| N-Miss | 0 | 2 | 2 | |
| Strongly disagree | 9 (7.5%) | 2 (8.7%) | 11 (7.7%) | |
| Somewhat disagree | 28 (23.3%) | 5 (21.7%) | 33 (23.1%) | |
| Neither agree nor disagree | 21 (17.5%) | 3 (13.0%) | 24 (16.8%) | |
| Somewhat agree | 42 (35.0%) | 10 (43.5%) | 52 (36.4%) | |
| Strongly agree | 20 (16.7%) | 3 (13.0%) | 23 (16.1%) | |
| Please rate your agreement with the following statements: I think cutting out screen use 1 hour before bed leads to better sleep. | 0.8021 | |||
| N-Miss | 0 | 1 | 1 | |
| Strongly disagree | 1 (0.8%) | 0 (0.0%) | 1 (0.7%) | |
| Somewhat disagree | 5 (4.2%) | 0 (0.0%) | 5 (3.5%) | |
| Neither agree nor disagree | 16 (13.3%) | 3 (12.5%) | 19 (13.2%) | |
| Somewhat agree | 40 (33.3%) | 10 (41.7%) | 50 (34.7%) | |
| Strongly agree | 58 (48.3%) | 11 (45.8%) | 69 (47.9%) | |
| Please rate your agreement with the following statements: I think exercising regularly leads to better sleep. | ||||
| N-Miss | 0 | 1 | 1 | |
| Strongly disagree | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Somewhat disagree | 2 (1.7%) | 0 (0.0%) | 2 (1.4%) | |
| Neither agree nor disagree | 4 (3.3%) | 1 (4.2%) | 5 (3.5%) | |
| Somewhat agree | 32 (26.7%) | 8 (33.3%) | 40 (27.8%) | |
| Strongly agree | 82 (68.3%) | 15 (62.5%) | 97 (67.4%) | |
| Please rate your agreement with the following statements: I think participating in breathing exercises during the day or before bed leads to better sleep. | ||||
| N-Miss | 0 | 1 | 1 | |
| Strongly disagree | 0 (0.0%) | 0 (0.0%) | 0 (0.0%) | |
| Somewhat disagree | 3 (2.5%) | 2 (8.3%) | 5 (3.5%) | |
| Neither agree nor disagree | 29 (24.2%) | 7 (29.2%) | 36 (25.0%) | |
| Somewhat agree | 49 (40.8%) | 9 (37.5%) | 58 (40.3%) | |
| Strongly agree | 39 (32.5%) | 6 (25.0%) | 45 (31.2%) | |
| Please rate your agreement with the following statements: In the next two weeks, I will stop using screens 1 hour before bed for better sleep. | 0.9021 | |||
| N-Miss | 1 | 2 | 3 | |
| Strongly disagree | 22 (18.5%) | 5 (21.7%) | 27 (19.0%) | |
| Somewhat disagree | 24 (20.2%) | 3 (13.0%) | 27 (19.0%) | |
| Neither agree nor disagree | 24 (20.2%) | 4 (17.4%) | 28 (19.7%) | |
| Somewhat agree | 34 (28.6%) | 7 (30.4%) | 41 (28.9%) | |
| Strongly agree | 15 (12.6%) | 4 (17.4%) | 19 (13.4%) | |
| Please rate your agreement with the following statements: In the next two weeks, I will exercise for at least 30 minutes total each day for better sleep. | 0.3261 | |||
| N-Miss | 0 | 2 | 2 | |
| Strongly disagree | 3 (2.5%) | 0 (0.0%) | 3 (2.1%) | |
| Somewhat disagree | 5 (4.2%) | 3 (13.0%) | 8 (5.6%) | |
| Neither agree nor disagree | 16 (13.3%) | 1 (4.3%) | 17 (11.9%) | |
| Somewhat agree | 42 (35.0%) | 8 (34.8%) | 50 (35.0%) | |
| Strongly agree | 54 (45.0%) | 11 (47.8%) | 65 (45.5%) | |
| Please rate your agreement with the following statements: In the next two weeks, I will do a daily breathing exercise for better sleep. | 0.9861 | |||
| N-Miss | 0 | 2 | 2 | |
| Strongly disagree | 10 (8.3%) | 2 (8.7%) | 12 (8.4%) | |
| Somewhat disagree | 17 (14.2%) | 4 (17.4%) | 21 (14.7%) | |
| Neither agree nor disagree | 22 (18.3%) | 4 (17.4%) | 26 (18.2%) | |
| Somewhat agree | 48 (40.0%) | 8 (34.8%) | 56 (39.2%) | |
| Strongly agree | 23 (19.2%) | 5 (21.7%) | 28 (19.6%) |
sleephygienepre <- readRDS(file="foranalysis.rds")
sleephygienepre <- sleephygienepre %>%
mutate(Q5_age = case_when(
Q5_age >= 18 & Q5_age <= 25 ~ "18-25",
Q5_age >= 26 & Q5_age <= 34 ~ "26-34",
Q5_age >= 35 & Q5_age <= 44 ~ "35-44",
Q5_age >= 45 & Q5_age <= 54 ~ "45-54",
Q5_age >= 55 & Q5_age < 64 ~ "55-64",
Q5_age >= 64 & Q5_age <= 75 ~ "64-75",
Q5_age > 75 ~ "75+",
is.na(Q5_age) ~ NA_character_
)) %>%
mutate(Q5_age = factor(Q5_age)) %>%
mutate(post = 0) %>%
mutate(
Q10_hoursofsleeplast5workdays = Q10_workdayhoursofsleep,
Q10_hoursofsleeppastweekend = Q11_weekendhoursofsleep,
Q61_howoftensleepypasttwoweeks = Q9_howoftensleepy
) %>%
select(post, Q3_role, Q2_program, Q4_gender, Q5_age, Q6_numberinhousehold, Q10_hoursofsleeplast5workdays, Q10_hoursofsleeppastweekend, Q61_howoftensleepypasttwoweeks)
sleephygienepost <- sleephygiene %>% mutate(post = 1) %>% select(post, Q3_role, Q2_program, Q4_gender, Q5_age, Q6_numberinhousehold, Q10_hoursofsleeplast5workdays, Q10_hoursofsleeppastweekend, Q61_howoftensleepypasttwoweeks)
sleephygienepreandpost <- rbind(sleephygienepre, sleephygienepost)
sleephygienepreandpost <- sleephygienepreandpost %>% mutate(Q61_smaller = case_when(
is.na(Q61_howoftensleepypasttwoweeks) ~ NA_character_,
Q61_howoftensleepypasttwoweeks == "Never" ~ "Never",
Q61_howoftensleepypasttwoweeks == "Rarely" ~ "Rarely",
Q61_howoftensleepypasttwoweeks == "Sometimes" ~ "Sometimes",
Q61_howoftensleepypasttwoweeks == "Very often" | Q61_howoftensleepypasttwoweeks == "Always" ~ "Very often or Always",
)) %>%
mutate(Q61_smaller = factor(Q61_smaller)) %>%
mutate(Q2_program = case_when(
Q2_program == "Post-doctoral student" ~ as.character("Post doctoral student"),
TRUE ~ as.character(Q2_program)
)) %>%
mutate(Q2_program = factor(Q2_program))
tab1 <- tableby(post ~ Q3_role +
Q2_program +
Q4_gender +
Q5_age +
Q6_numberinhousehold +
Q10_hoursofsleeplast5workdays +
Q10_hoursofsleeppastweekend +
Q61_smaller,
data=sleephygienepreandpost, test=TRUE, total=TRUE,
numeric.stats=c("medianq1q3"), numeric.test="kwt", cat.test="chisq")
summary(tab1, title='Table 1. Baseline information', pfootnote=TRUE, digits = 2)| 0 (N=209) | 1 (N=157) | Total (N=366) | p value | |
|---|---|---|---|---|
| Q3_role | 0.0371 | |||
| N-Miss | 3 | 4 | 7 | |
| Faculty/Staff Member | 6 (2.9%) | 10 (6.5%) | 16 (4.5%) | |
| Full-time student | 140 (68.0%) | 86 (56.2%) | 226 (63.0%) | |
| Part-time student | 60 (29.1%) | 55 (35.9%) | 115 (32.0%) | |
| Not affiliated with Bloomberg School of Public Health | 0 (0.0%) | 2 (1.3%) | 2 (0.6%) | |
| Q2_program | 0.0141 | |||
| N-Miss | 9 | 16 | 25 | |
| Doctoral Student | 54 (27.0%) | 31 (22.0%) | 85 (24.9%) | |
| Masters Student | 140 (70.0%) | 94 (66.7%) | 234 (68.6%) | |
| Other | 1 (0.5%) | 6 (4.3%) | 7 (2.1%) | |
| Post doctoral student | 5 (2.5%) | 10 (7.1%) | 15 (4.4%) | |
| Q4_gender | 0.5991 | |||
| N-Miss | 3 | 4 | 7 | |
| Female | 166 (80.6%) | 127 (83.0%) | 293 (81.6%) | |
| Male | 35 (17.0%) | 25 (16.3%) | 60 (16.7%) | |
| Non-binary / third gender | 4 (1.9%) | 1 (0.7%) | 5 (1.4%) | |
| Prefer not to say | 1 (0.5%) | 0 (0.0%) | 1 (0.3%) | |
| Q5_age | 0.5091 | |||
| N-Miss | 5 | 4 | 9 | |
| 18-25 | 64 (31.4%) | 45 (29.4%) | 109 (30.5%) | |
| 26-34 | 98 (48.0%) | 67 (43.8%) | 165 (46.2%) | |
| 35-44 | 32 (15.7%) | 26 (17.0%) | 58 (16.2%) | |
| 45-54 | 9 (4.4%) | 13 (8.5%) | 22 (6.2%) | |
| 55-64 | 1 (0.5%) | 1 (0.7%) | 2 (0.6%) | |
| 64-75 | 0 (0.0%) | 1 (0.7%) | 1 (0.3%) | |
| How many people live in your household, including yourself? | 0.2292 | |||
| Median (Q1, Q3) | 2.00 (2.00, 3.00) | 2.00 (2.00, 3.00) | 2.00 (2.00, 3.00) | |
| During the past 5 workdays, how many hours of sleep did you get per night on average? | 0.6022 | |||
| Median (Q1, Q3) | 7.00 (6.00, 7.50) | 7.00 (6.00, 7.00) | 7.00 (6.00, 7.50) | |
| During the past weekend, how many hours of sleep did you get per night on average? | 0.0792 | |||
| Median (Q1, Q3) | 8.00 (7.00, 9.00) | 8.00 (7.00, 8.00) | 8.00 (7.00, 9.00) | |
| Q61_smaller | 0.0711 | |||
| N-Miss | 69 | 57 | 126 | |
| Never | 3 (2.1%) | 2 (2.0%) | 5 (2.1%) | |
| Rarely | 27 (19.3%) | 25 (25.0%) | 52 (21.7%) | |
| Sometimes | 99 (70.7%) | 56 (56.0%) | 155 (64.6%) | |
| Very often or Always | 11 (7.9%) | 17 (17.0%) | 28 (11.7%) |
library(sjPlot)
sleephygiene <- sleephygiene %>% mutate(Q69_didyouengagewiththecampaignbinary = case_when(
Q69_didyouengagewiththecampaign == "No" ~ 0,
Q69_didyouengagewiththecampaign == "Yes" ~ 1)) %>%
mutate(Q4_gender_binary = case_when(
Q4_gender == "Male" ~ 1,
Q4_gender == "Female" ~ 0,
TRUE ~ NA_real_
)) %>%
mutate(Q4_gender_binary = factor(Q4_gender_binary, labels = c("Female", "Male"))) %>%
mutate(happywithsleepqualitycombined = case_when(
Q90_areyouhappywithyoursleepquality_awareofcampaign == "Yes" ~ 1,
Q90_areyouhappywithyoursleepquality_awareofcampaign == "No" ~ 0,
Q91_areyouhappywithyoursleepquality_notawareofcampaign == "Yes" ~ 1,
Q91_areyouhappywithyoursleepquality_notawareofcampaign == "No" ~ 0,
Q89_ratesleepquality_notawareofcampaign == "Good" ~ 1,
Q89_ratesleepquality_notawareofcampaign == "Excellent" ~ 1,
Q89_ratesleepquality_notawareofcampaign == "Poor" ~ 0,
Q89_ratesleepquality_notawareofcampaign == "Fair" ~ 0,
)) %>%
mutate(happywithsleepqualitycombined = factor(happywithsleepqualitycombined)) %>%
mutate(Q67_1 = case_when(
is.na(Q67_1) ~ 0,
TRUE ~ as.numeric(Q67_1)
)) %>%
mutate(Q67_2 = case_when(
is.na(Q67_2) ~ 0,
TRUE ~ as.numeric(Q67_2)
)) %>%
mutate(Q67_3 = case_when(
is.na(Q67_3) ~ 0,
TRUE ~ as.numeric(Q67_3)
)) %>%
mutate(pointscombinedperdays = Q67_1 + Q67_2 + Q67_3) %>%
mutate(ratesleepqualitycombined = case_when(
Q89_ratesleepquality_notawareofcampaign == "Good" ~ 1,
Q89_ratesleepquality_notawareofcampaign == "Excellent" ~ 1,
Q89_ratesleepquality_notawareofcampaign == "Poor" ~ 0,
Q89_ratesleepquality_notawareofcampaign == "Fair" ~ 0,
)) %>%
mutate(POINTSFROMPICS1 = case_when(
Q96_picture2 == "Yes" ~ 1,
TRUE ~ 0
)) %>%
mutate(POINTSFROMPICS2 = case_when(
Q96_picture4 == "Yes" ~ 1,
TRUE ~ 0
)) %>% mutate(POINTSFROMPICS3 = case_when(
Q96_picture5 == "Yes" ~ 1,
TRUE ~ 0
)) %>% mutate(POINTSFROMPICS4 = case_when(
Q96_picture7 == "Yes" ~ 1,
TRUE ~ 0
)) %>% mutate(POINTFROMENGAGEMENT = case_when(
Q69_didyouengagewiththecampaign == "Yes" ~ 1,
TRUE ~ 0
)) %>% mutate(
POINTSFROMPARTICIPATION = X.MoveMore + X.PowerDown + X.Breathe
) %>%
mutate(TOTALPOINTS = pointscombinedperdays + POINTSFROMPICS1 + POINTSFROMPICS2 + POINTSFROMPICS3 + POINTSFROMPICS4 + POINTFROMENGAGEMENT + POINTSFROMPARTICIPATION) %>% mutate(AGESMALLERCATEGORIES = case_when(
Q5_age == "18-25" ~ 0,
Q5_age == "26-34" ~ 0,
Q5_age == "35-44" ~ 0,
Q5_age == "45-54" ~ 1,
Q5_age == "55-64" ~ 1,
Q5_age == "64-75" ~ 1
))
#Participating in the campaign
mylogit <- glm(Q69_didyouengagewiththecampaignbinary ~ Q4_gender_binary + Q10_hoursofsleeplast5workdays + Q10_hoursofsleeppastweekend, family = binomial(link = "logit"), data = sleephygiene)
tab_model(mylogit)| Q69_didyouengagewiththecampaignbinary | |||
|---|---|---|---|
| Predictors | Odds Ratios | CI | p |
| (Intercept) | 0.04 | 0.00 – 1.08 | 0.063 |
| Q4_gender_binary: Male | 0.54 | 0.08 – 2.10 | 0.434 |
|
On average, how many hours of sleep did you get per night during the following periods of time: during the last 5 workdays? |
0.86 | 0.55 – 1.38 | 0.516 |
|
On average, how many hours of sleep did you get per night during the following periods of time: during the past weekend? |
1.40 | 0.93 – 2.15 | 0.111 |
| Observations | 142 | ||
| R2 Tjur | 0.024 | ||
#Happy with sleep quality
mylogit <- glm(happywithsleepqualitycombined ~ Q4_gender_binary + Q10_hoursofsleeplast5workdays + Q10_hoursofsleeppastweekend + Q69_didyouengagewiththecampaignbinary, family = binomial(link = "logit"), data = sleephygiene)
tab_model(mylogit)| happywithsleepqualitycombined | |||
|---|---|---|---|
| Predictors | Odds Ratios | CI | p |
| (Intercept) | 0.00 | 0.00 – 0.01 | <0.001 |
| Q4_gender_binary: Male | 1.55 | 0.55 – 4.47 | 0.404 |
|
On average, how many hours of sleep did you get per night during the following periods of time: during the last 5 workdays? |
2.85 | 1.79 – 4.84 | <0.001 |
|
On average, how many hours of sleep did you get per night during the following periods of time: during the past weekend? |
1.05 | 0.73 – 1.51 | 0.780 |
| Q69_didyouengagewiththecampaignbinary | 1.48 | 0.52 – 4.31 | 0.461 |
| Observations | 142 | ||
| R2 Tjur | 0.212 | ||
mylogit <- glm(happywithsleepqualitycombined ~ Q10_hoursofsleeppastweekend + Q4_gender_binary + pointscombinedperdays, family = binomial(link = "logit"), data = sleephygiene)
tab_model(mylogit)| happywithsleepqualitycombined | |||
|---|---|---|---|
| Predictors | Odds Ratios | CI | p |
| (Intercept) | 0.01 | 0.00 – 0.09 | <0.001 |
|
On average, how many hours of sleep did you get per night during the following periods of time: during the past weekend? |
1.65 | 1.23 – 2.26 | 0.001 |
| Q4_gender_binary: Male | 1.61 | 0.60 – 4.43 | 0.344 |
| pointscombinedperdays | 1.06 | 1.01 – 1.11 | 0.023 |
| Observations | 142 | ||
| R2 Tjur | 0.107 | ||
attach(sleephygiene)## The following objects are masked from sleephygiene (pos = 4):
##
## Class.announcement, Colleague, Decrease.alcohol.consumption,
## Deep.breathing.exercises,
## Discussion.with.others.about.the.campaign, DistributionChannel,
## Duration..in.seconds., Finished, Friends,
## I.had.more.flexibility.in.my.day, ID,
## Incorporating.moderate.exercise.as.part.of.your.day,
## Increase.natural.bright.light.exposure.in.the.day, Instagram,
## Instagram.1, Instagram.campaign, JHSPH.Activities.email,
## LocationLatitude, LocationLongitude, Messages.were.too.frequent,
## Messages.were.too.infrequent, None.of.the.above,
## Not.drinking.caffeinated.beverages.late.in.the.day, Other,
## Other..please.explain., Other..please.explain.below., Progress, Q1,
## Q1_consent, Q10_2, Q10_3, Q10_hoursofsleeplast5workdays,
## Q10_hoursofsleeppastweekend, Q2, Q2_5_TEXT, Q2_program, Q3,
## Q3_role, Q37, Q37_employed, Q38, Q38_worksetting, Q39,
## Q39_dayornight, Q4, Q4_gender, Q44_1, Q44_2, Q44_3, Q44_4, Q44_5,
## Q44_6, Q44_7, Q44_8, Q44_9,
## Q44_breathingexercisesleadstobettersleep,
## Q44_cuttingoutscreenleadstobettersleep,
## Q44_exercisingleadstobettersleep, Q44_feelpositive,
## Q44_goodnightsleepisimportant, Q44_iwillbreathe, Q44_iwillexercise,
## Q44_iwillstopscreens, Q44_mentalclarity, Q5, Q5_age, Q52,
## Q52_additionalcomments, Q59_1, Q59_2, Q59_3, Q59_4,
## Q59_cancutoutscreen, Q59_canexercise,
## Q59_canmaintainhealthysleephabits, Q59_canparticipateinbreathing,
## Q6, Q6_numberinhousehold, Q61, Q61_howoftensleepypasttwoweeks, Q62,
## Q62_howdidyouengage, Q63, Q63_recalltoolsfreetect, Q64,
## Q64_whichtechniquedidyoutry, Q67_1, Q67_2, Q67_3, Q67_breathing,
## Q67_move30minutes, Q67_powerdown, Q68, Q68_timing, Q69,
## Q69_didyouengagewiththecampaign, Q70, Q70_18_TEXT,
## Q70_timingoftextsinconvenient, Q71,
## Q71_whichchannelmosteducational, Q72, Q73, Q73_5_TEXT,
## Q73_hearabouthow, Q74, Q74_rafflemotivating, Q75_1, Q75_2, Q75_3,
## Q75_breathing, Q75_moving, Q75_powerdown, Q79, Q79_5_TEXT,
## Q79_moresuccessfuloutcomsuggestions, Q81,
## Q81_seenorheardfromGNbloombergcampaign, Q82,
## Q82_knowanyonewhoengaged, Q83, Q83_talkedtowho, Q84,
## Q84_awareofhowtoimprovesleepquality, Q85,
## Q85_waystoimprovesleepquality, Q87, Q87_idealtime, Q89_1,
## Q89_ratesleepquality_notawareofcampaign, Q9,
## Q9_howoftensleepypastmonth, Q90,
## Q90_areyouhappywithyoursleepquality_awareofcampaign, Q91,
## Q91_areyouhappywithyoursleepquality_notawareofcampaign, Q92,
## Q92_notSPHemployed, Q93, Q93_worksetting, Q94, Q94_dayornight, Q95,
## Q95_talkedtoanyone, Q96_1, Q96_2, Q96_3, Q96_4, Q96_5, Q96_6,
## Q96_7, Q96_8, Q96_picture1, Q96_picture2, Q96_picture3,
## Q96_picture4, Q96_picture5, Q96_picture6, Q96_picture7,
## Q96_picture8, Received.message.too.early.in.the.day,
## Received.message.too.late.in.the.day,
## Reduce.irregular.or.long.daytime.naps, Relatives, Spouse,
## Switching.off.electronics.one.hour.before.sleep,
## Take.a.melatonin.supplement, Text, Text.message.campaign,
## The.campaign.was.longer,
## There.was.an.in.person.on.campus.component.to.the.campaign,
## There.were.subject.matter.experts.checking.in.with.me.one.on.one,
## Try.to.sleep.and.wake.at.consistent.times, UserLanguage,
## Word.of.mouth.discussion.with.others,
## Word.of.mouth.discussion.with.others.1, X.Breathe, X.MoveMore,
## X.PowerDown
mylogit <- glm(happywithsleepqualitycombined ~ TOTALPOINTS + Q10_hoursofsleeplast5workdays + Q3_role + Q4_gender_binary + AGESMALLERCATEGORIES, family = binomial(link = "logit"), data = sleephygiene)
tab_model(mylogit)| happywithsleepqualitycombined | |||
|---|---|---|---|
| Predictors | Odds Ratios | CI | p |
| (Intercept) | 0.00 | 0.00 – 0.00 | <0.001 |
| TOTALPOINTS | 1.07 | 1.02 – 1.13 | 0.011 |
|
On average, how many hours of sleep did you get per night during the following periods of time: during the last 5 workdays? |
3.39 | 2.15 – 5.77 | <0.001 |
|
What is your role at Bloomberg: Full-time student |
1.44 | 0.26 – 8.37 | 0.678 |
|
What is your role at Bloomberg: Part-time student |
1.01 | 0.17 – 6.04 | 0.992 |
| Q4_gender_binary: Male | 1.43 | 0.49 – 4.28 | 0.514 |
| AGESMALLERCATEGORIES | 1.66 | 0.37 – 7.32 | 0.500 |
| Observations | 142 | ||
| R2 Tjur | 0.251 | ||
#knowing campaign exists
#ACTION IS THE OUTCOME
#Can you recall images
#texting campaign
#composite outcome HIGH AND LOW EXPOSURE
#HIGH VS LOW EXPOSURE
#LOGISTIC REGRESSION -- BEHAVIOR
#OR LINEAR REGRESSION
#Causal criteria...